﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Nathan_tools
{
    public partial class sql_tools : Form
    {
        public sql_tools()
        {
            InitializeComponent();
        }

        private void btn_sql_update_Click(object sender, EventArgs e)
        {
            tb_sql_fields12.Clear();
            if (tb_sql_fields11.Text.Trim() != "")
            {
                string[] content = tb_sql_fields11.Text.Replace("\r", "").Split('\n');
                foreach (string s in content)
                {
                    try
                    {
                        tb_sql_fields12.Text += s + "=@" + s + ",\r\n";
                    }
                    catch { }
                }
            }
        }

        private void btn_copytoclipboard_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(tb_sql_fields12.Text);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            tb_sql_fields22.Clear();
            if (tb_sql_fields21.Text.Trim() != "")
            {
                string[] content = tb_sql_fields21.Text.Split(',');
                foreach (string s in content)
                {
                   string  ss = s.Trim();
                    try
                    {
                        tb_sql_fields22.Text +="@" + ss + ",";
                    }
                    catch { }
                }

            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string[] temp = textBox21.Text.Split(',');
            foreach (string s in temp)
            { 
            textBox22 .Text +=s+"@"+s.Replace ("=",",").Trim ();
            }
        }

        private void sql_tools_Load(object sender, EventArgs e)
        {

        }
    }
}
